{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Other Sources Available to gtobssim\n",
    "\n",
    "This page describes the type of sources that are possible to simulate using **gtobssim**.\n",
    "\n",
    "In the examples below, the parameter escale specifies the units of energy used elsewhere in the source specification. It can have values `MeV` or `GeV`, and defaults to `GeV`.\n",
    "\n",
    "Notice that coordinates can be specified either as celestial (J2000) or Galactic. For example:\n",
    "\n",
    "    <celestial_dir ra=\"123.45\" dec=\"67.8\"/> or <galactic_dir l=\"23.45\" b=\"-67.8\"/> \n",
    "\n",
    "For each source, the entries in the param string are described.\n",
    "\n",
    "**Notes**:\n",
    "\n",
    "1. The XML tag `<use_spectrum frame=\"galaxy\"/>` indicates that the photons are to be generated in Celestial coordinates as opposed to instrument coordinates. Its use in these XML definitions is idiomatic and specific to particular source implementations and generally applies to diffuse sources only. Point sources **should not** use this tag; use `celestial_dir` or `galactic_dir` instead.\n",
    "\n",
    "2. **Optional parameter default values** are given in parentheses."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Gamma-ray point source\n",
    "\n",
    "A point source with a steady light curve."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "In this example, a monochromatic (110 GeV) point source with flux 5e-4 m^(-2) s^(-1) is placed in the direction of the Galactic center:\n",
    "\n",
    "```xml\n",
    "<source name=\"galcenter\" flux=\"5e-4\">\n",
    "   <spectrum escale=\"GeV\">\n",
    "      <particle name=\"gamma\">\n",
    "         <energy e=\"110.\"/>\n",
    "      </particle>\n",
    "      <galactic_dir l=\"0\" b=\"0\"/>\n",
    "   </spectrum>\n",
    "</source> \n",
    "```\n",
    "\n",
    "You may download the xml file from [here](https://fermi.gsfc.nasa.gov/ssc/data/analysis/scitools/data/OtherSrsObssim/point_source_monochromatic.xml). "
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "In this example, a source with a power-law spectrum with photon spectral index 1.62 and flux 0.00928 m-2 s-1 between 30 MeV and 100 GeV is placed at RA 128.73, Dec -45.2.  Note that \"gamma\" is used both to indicate the particle type and to denote the spectral index:\n",
    "\n",
    "```xml\n",
    "<source name=\"vela\" flux=\"0.00928\">\n",
    "   <spectrum escale=\"MeV\">\n",
    "      <particle name=\"gamma\">\n",
    "         <power_law emin=\"30.0\" emax=\"100000.\" gamma=\"1.62\"/>\n",
    "      </particle>\n",
    "      <celestial_dir ra=\"128.73\" dec=\"-45.2\"/>\n",
    "   </spectrum>\n",
    "</source>\n",
    "```\n",
    "\n",
    "You may download the xml file from [here](https://fermi.gsfc.nasa.gov/ssc/data/analysis/scitools/data/OtherSrsObssim/point_source_powerlaw.xml)."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "In this example, the source above is modified to have a broken power-law spectrum, with break energy ebreak and spectral index gamma2 above the break:\n",
    "\n",
    "```xml\n",
    "<source name=\"vela\" flux=\"0.00928\">\n",
    "   <spectrum escale=\"MeV\">\n",
    "      <particle name=\"gamma\">\n",
    "         <power_law emin=\"30.0\" emax=\"100000. \"gamma=\"1.62\" ebreak=\"3000\" gamma2=\"2.5\"/>\n",
    "         </particle>\n",
    "      <celestial_dir ra=\"128.73\" dec=\"-45.2\"/>\n",
    "   </spectrum>\n",
    "</source>\n",
    "```\n",
    "\n",
    "You may download the xml file from [here](https://fermi.gsfc.nasa.gov/ssc/data/analysis/scitools/data/OtherSrsObssim/point_source_broken_power_law.xml)."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# GaussianSource:\n",
    "\n",
    "Incident photons are distributed as a 2D Gaussian projected on the sky.\n",
    "\n",
    "* **flux** - Total flux in units of m-2 s-1.\n",
    "* **gamma** - Photon spectral index such that dN/dE ∝ E-Γ.\n",
    "* **RA** - Source centroid J2000 right ascension in degrees.\n",
    "* **Dec** - Source centroid J2000 declination in degrees.\n",
    "* **major axis (default: 1)** - Semi-major axis of the 68% CL contour in degrees.\n",
    "* **minor axis (default: 1)** - Semi-minor axis of the 68% CL contour in degrees.\n",
    "* **position angle (default: 0)** - Position angle of the major axis measured wrt North in degrees.\n",
    "* **Emin (default: 30)** - Minimum photon energy in MeV.\n",
    "* **Emax (default: 1e5)** - Maximum photon energy in MeV."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "```xml\n",
    "<source name=\"gaussian_source\">\n",
    "   <spectrum escale=\"MeV\">\n",
    "      <SpectrumClass name=\"GaussianSource\" params=\"0.1, 2.1, 45., 30., 3., 0.5, 45, 30., 2e5\"/>\n",
    "      <use_spectrum frame=\"galaxy\"/>\n",
    "   </spectrum>\n",
    "</source>\n",
    "```\n",
    "You may download the xml file from [here](https://fermi.gsfc.nasa.gov/ssc/data/analysis/scitools/data/OtherSrsObssim/gaussian.xml)."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# FileSpectrum:\n",
    "\n",
    "Spectrum defining a source for which the energy distribution is determined by a 2 column ascii file. The first column contains the energies, and second column contains the differential flux at those energies. The units of energy in the first column should match the escale attribute that is set in the spectrum tag. **Do not set the flux attribute in the spectrum tag**, otherwise the fluxes for this source will not be correct. To be explicit, a spectrum tag that looks like this:\n",
    "\n",
    "```xml\n",
    "<spectrum escale=\"MeV\" flux=\"1\">\n",
    "```\n",
    "\n",
    "is **not correct**, whereas\n",
    "\n",
    "```xml\n",
    "<spectrum escale=\"MeV\">\n",
    "```\n",
    "\n",
    "is ok.\n",
    "\n",
    "* **flux** - Total flux of the source. This acts as a normalization of the spectrum. If this attribute is set to zero, i.e., flux=\"0\", then the spectrum data in the file will be integrated and that integral will be used as the source flux. The units are assumed to be m-2 s-1.\n",
    "* **specFile** - Name (and path) to the ascii file The position of the source is determined in the usual way, in the XML definition.\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "```xml\n",
    "<source name=\"FileSpectrum\">\n",
    "   <spectrum escale=\"MeV\" >\n",
    "      <SpectrumClass name=\"FileSpectrum \"params=\"flux=0.,specFile=$(FERMI_DIR)/refdata/fermi/genericSources/dm120gev.dat\"/>\n",
    "      <celestial_dir ra=\"194.04\" dec=\"-5.789\"/>\n",
    "   </spectrum>\n",
    "</source>\n",
    "```\n",
    "\n",
    "You may download the xml file from [here](https://fermi.gsfc.nasa.gov/ssc/data/analysis/scitools/data/OtherSrsObssim/FileSpectrum.xml)."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Isotropic:\n",
    "\n",
    "Photons are generated uniformly on the sky following a power-law spectrum.\n",
    "\n",
    "* **flux** - in units of m-2 s-1.\n",
    "* **gamma** - Photon spectral index such that dN/dE ∝ E-Γ.\n",
    "* **Emin (default: 30)** - Minimum photon energy in MeV.\n",
    "* **Emax (default: 1e5)** - Maximum photon energy in MeV."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "```xml\n",
    "<source name=\"Extragalactic_diffuse\">\n",
    "   <spectrum escale=\"MeV\">\n",
    "      <SpectrumClass name=\"Isotropic\" params=\"10.7, 2.1, 20., 2e5\"/>\n",
    "      <use_spectrum frame=\"galaxy\"/>\n",
    "   </spectrum>\n",
    "</source>\n",
    "```\n",
    "You may download the xml file from [here](https://fermi.gsfc.nasa.gov/ssc/data/analysis/scitools/data/OtherSrsObssim/Isotropic.xml). "
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# MapCube:\n",
    "\n",
    "Incident photons are generated from a 3D FITS image comprising an energy axis for the 3rd dimension and, e.g., RA and Dec as the sky coordinates. The pixel values in each image should have dimensions of dN/dE dt dA dΩ. The absolute normalization is not important as the image will be rescaled by the flux parameter. The energies corresponding to each image frame must be given in binary table extension.\n",
    "\n",
    "Here is an [example FITS file](http://www-glast.stanford.edu/cgi-bin/viewcvs/celestialSources/genericSources/data/map_cube_example.fits?rev=1.1&view=log), and here is a thorough treatment of [Celestial coordinate projections for FITS images](http://adsabs.harvard.edu/cgi-bin/nph-bib_query?bibcode=2002A&A...395.1077C&db_key=AST&data_type=HTML&format=&high=42fcf9814623050).\n",
    "\n",
    "* **flux** - Total flux from the map, integrated over solid angle, in units of m-2 s-1.\n",
    "* **FITS file** - A [plate-carree](http://en.wikipedia.org/wiki/Plate_Carr%C3%A9e_Projection) FITS image in Galactic '(CTYPE1 = GLON-CAR, CTYPE2 = GLAT-CAR)' or J2000 '(CTYPE1 = RA---CAR, CTYPE2 = DEC--CAR)' coordinates."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "```xml\n",
    "<source name=\"map_cube_source\">\n",
    "   <spectrum escale=\"MeV\">\n",
    "      <SpectrumClass name=\"MapCube\" params=\"1., $(FERMI_DIR)/refdata/fermi/genericSources/test_image.fits \"/>\n",
    "      <use_spectrum frame=\"galaxy\"/>\n",
    "   </spectrum>\n",
    "</source>\n",
    "```\n",
    "\n",
    "You may download the xml file from [here](https://fermi.gsfc.nasa.gov/ssc/data/analysis/scitools/data/OtherSrsObssim/MapCube.xml)."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# MapSource:\n",
    "\n",
    "Photons are generated using a 2D FITS image as a template. A single power-law spectrum is used for the entire map.\n",
    "\n",
    "* **flux** - Total flux from the map, integrated over solid angle, in units of m-2 s-1.\n",
    "* **gamma** - Photon spectral index such that dN/dE ∝ E-Γ.\n",
    "* **FITS file** -- A plate-carree FITS image in Galactic '(CTYPE1 = GLON-CAR, CTYPE2 = GLAT-CAR)' or J2000 '(CTYPE1 = RA---CAR, CTYPE2 = DEC--CAR)' coordinates.\n",
    "* **Emin (default: 30)** - Minimum photon energy in MeV.\n",
    "* **Emax (default: 1e5)** - Maximum photon energy in MeV."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "```xml\n",
    "<!-- MapSource version of the Galactic Diffuse model -->\n",
    "   <source name=\"Galactic_diffuse\">\n",
    "      <spectrum escale=\"MeV\">\n",
    "         <SpectrumClass name=\"MapSource\" params=\"17.,2.1,$(FERMI_DIR)/refdata/fermi/galdiffuse/EGRET_diffuse_gal.fits,30.,2e5\"/>\n",
    "         <use_spectrum frame=\"galaxy\"/>\n",
    "   </spectrum>\n",
    "</source>\n",
    "```\n",
    "You may download the xml file from [here](https://fermi.gsfc.nasa.gov/ssc/data/analysis/scitools/data/OtherSrsObssim/MapSource.xml). "
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# FileSpectrumMap:\n",
    "\n",
    "Same as **File Spectrum**, but now the source can be extended in space.\n",
    "\n",
    "* All the parameters of FileSpectrum.\n",
    "* All the parameters of MapSource."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "```xml\n",
    "<source name=\"filespectrummap_test\">\n",
    "   <spectrum escale=\"GeV\" flux=\"1.\">\n",
    "      <SpectrumClass name=\"FileSpectrumMap\" params=\"flux=17.,fitsFile=$(FERMI_DIR)/refdata/fermi/galdiffuse/EGRET_diffuse_gal.fits,\n",
    "specFile=$(FERMI_DIR)/refdata/fermi/genericSources/dm120gev.dat,emin=100.,emax=1100, tf1precision=100,gamma=2,lonMin=-180,lonMax=180,latMin=-90,latMax=90\"/>\n",
    "      <use_spectrum frame=\"galaxy\"/>\n",
    "   </spectrum>\n",
    "</source>\n",
    "```\n",
    "You may download the xml file from [here](https://fermi.gsfc.nasa.gov/ssc/data/analysis/scitools/data/OtherSrsObssim/FileSpectrumMap.xml)."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# TF1Map:\n",
    "\n",
    "Same as 3) but now the source can be extended in space.\n",
    "\n",
    "* All the parameters of TF1Spectrum.\n",
    "* All the parameters of MapSource."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "```xml\n",
    "<source name=\"tf1map_test\">\n",
    "   <spectrum escale=\"MeV\">\n",
    "      <SpectrumClass name=\"TF1Map\" params=\"flux=17.,tf1name=FT1Map_TEST formula=-0.0001*(100.-x)*(1100.-x), fitsFile=$(FERMI_DIR)/refdata/fermi/galdiffuse/EGRET_diffuse_gal.fits,emin=100.,emax=1100,tf1precision=100,gamma=2,lonMin=-180,lonMax=180,latMin=-90,latMax=90\"/>\n",
    "      <use_spectrum frame=\"galaxy\"/>\n",
    "   </spectrum>\n",
    "</source>\n",
    "```\n",
    "You may download the xml file from [here](https://fermi.gsfc.nasa.gov/ssc/data/analysis/scitools/data/OtherSrsObssim/TF1Map.xml). "
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# PeriodicSource:\n",
    "\n",
    "A point source with sinusoidal light curve.\n",
    "\n",
    "* **flux** - Average flux in units of m-2 s-1.\n",
    "* **gamma** - Photon spectral index such that dN/dE ∝ E-Γ.\n",
    "* **period** - Source period in seconds.\n",
    "* **amplitude (default: 0.5)** - Amplitude of the sinusoidal modulation.\n",
    "* **phi0 (default: 0)** - Phase offset specified on the unit interval.\n",
    "* **Emin (default: 30)** - Minimum photon energy in MeV.\n",
    "* **Emax (default: 1e5)** - Maximum photon energy in MeV.\n",
    "\n",
    "```xml\n",
    "<source name=\"periodic_source\">\n",
    "   <spectrum escale=\"MeV\">\n",
    "      <SpectrumClass name=\"PeriodicSource \"params=\"0.1, 2.1, 1e3, 1, 0.75, 30., 2e5\"/>\n",
    "      <galactic_dir l=\"0\" b=\"0\"/>\n",
    "   </spectrum>\n",
    "</source>\n",
    "```\n",
    "You may download the xml file from [here](https://fermi.gsfc.nasa.gov/ssc/data/analysis/scitools/data/OtherSrsObssim/PeriodicSource.xml)."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# GRBobs:\n",
    "\n",
    "**Note**: The GRBobs package is a redefinition of the GRB phenomenological model for Gamma-Ray Bursts, using the same schema as the GRB physical model (GRB package) but, instead of exploring the physics for deriving light curves and the spectra, it uses phenomenological prescriptions.\n",
    "\n",
    "**The xml spectrum object** has to be defined as follows:\n",
    "```xml\n",
    "<source name=\" GRB1 \">\n",
    "   <spectrum escale=\"MeV\">\n",
    "      <SpectrumClass name=\"GRBobsmanager\" params=\"100,0.0e-5,20,-1.0,-2.25,100, 1\"/>\n",
    "      <celestial_dir ra=\"10.\" dec=\"22.\"/>\n",
    "   </spectrum>\n",
    "</source>\n",
    "```\n",
    "You may download the xml file from [here](https://fermi.gsfc.nasa.gov/ssc/data/analysis/scitools/data/OtherSrsObssim/GRB1.xml). \n",
    "\n",
    "**where the params are:**\n",
    "\n",
    "* Starting time of the burst (s)\n",
    "* Fluence in *ergs/cm2*. If it is 0 then it has sampled from the BATSE fluence distribution.\n",
    "* The number of pulses of the bursts.\n",
    "* The low energy spectral index (α)\n",
    "* The high energy spectral index (β)\n",
    "* The minimim energy for extracting photons (in MeV).\n",
    "* The flag for the GBM output. (1==YES and 0=NO). If GBM output is generated, the sumulator is slower and an additional text file will be created (see, [GRBobsSim::SaveGBMDefinition](http://www.slac.stanford.edu/exp/glast/ground/software/status/documentation/ScienceTools/latest/celestialSources/GRBobs/latest/class_g_r_bobs_sim.html#a12) and [GRBobsSim::GetGBMFlux](http://www.slac.stanford.edu/exp/glast/ground/software/status/documentation/ScienceTools/latest/celestialSources/GRBobs/latest/class_g_r_bobs_sim.html#a11))\n",
    "\n",
    "Also see:\n",
    "\n",
    "* [GRBobs Package: phenomenological model for GRB](http://www.slac.stanford.edu/exp/glast/ground/software/status/documentation/ScienceTools/latest/celestialSources/GRBobs/latest/main.html)\n",
    "* [Gamma-Ray Burst @ Pisa](http://glast.pi.infn.it/Nicola/GRB.html)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Pulsar:\n",
    "\n",
    "A pulsar source whose light curve is given by an ascii template file.\n",
    "\n",
    "* **flux** - Average flux in units of m-2 s-1.\n",
    "* **gamma** - Photon spectral index such that dN/dE ∝ E-Γ.\n",
    "* **period** - Pulsar period in seconds.\n",
    "* **pdot** - Time derivative of the pulsar period in s s-1.\n",
    "* **t0** - Reference epoch in MET seconds.\n",
    "* **template file** - Filename of the ascii light curve template. The file should consist of two columns, phase and intensity. The phase intervals must be uniformly spaced. The phase scale and absolute intensities are arbitrary and rescaled using the period and flux parameter values.\n",
    "* **phi0 (default: 0)** - Phase offset in the unit interval.\n",
    "* **Emin (default: 30)** - Minimum photon energy in MeV.\n",
    "* **Emax (default: 1e5)** - Maximum photon energy in MeV."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "```xml\n",
    "<source name=\"Crab_Pulsar\">\n",
    "   <spectrum escale=\"MeV\">\n",
    "      <SpectrumClass name=\"Pulsar\" params=\"1e-3,2.,0.033,0,0,$(FERMI_DIR)/refdata/fermi/observationSim/CrabTemplate.dat\"/>       <celestial_dir ra=\"83.57\" dec=\"22.01\"/>\n",
    "   </spectrum>\n",
    "</source>\n",
    "```\n",
    "You may download the xml file from [here](https://fermi.gsfc.nasa.gov/ssc/data/analysis/scitools/data/OtherSrsObssim/PulsarSource.xml). "
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# SimpleTransient:\n",
    "\n",
    "A point source with a single active interval during which it has a constant flux and power-law spectrum.\n",
    "\n",
    "* **flux** - Flux while in the active state in units of m-2 s-1.\n",
    "* **gamma** - Photon spectral index such that dN/dE ∝ E-Γ.\n",
    "* **tstart** - Start time of the active state in MET seconds.\n",
    "* **tstop** - Stop time of the active state in MET seconds.\n",
    "* **Emin (default = 30)** - Minimum photon energy in MeV.\n",
    "* **Emax (default = 1e5)** - Maximum photon energy in MeV."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "```xml\n",
    "<source name=\"simple_transient\">\n",
    "   <spectrum escale=\"MeV\">\n",
    "      <SpectrumClass name=\"SimpleTransient\" params=\"10., 2., 1e3, 1.1e3, 30., 2e5\"/>\n",
    "      <celestial_dir ra=\"83.\" dec=\"22.\"/>\n",
    "   </spectrum>\n",
    "</source>\n",
    "```\n",
    "You may download the xml file from [here](https://fermi.gsfc.nasa.gov/ssc/data/analysis/scitools/data/OtherSrsObssim/SimpleTransient.xml). "
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# SpectralTransient:\n",
    "\n",
    "An ascii or FITS file containing the light curve data is used as a template. Here are example [ascii](http://www-glast.stanford.edu/cgi-bin/viewcvs/celestialSources/genericSources/data/testTemplate.dat?rev=1.2&view=markup) and [FITS](ftp://ftp.slac.stanford.edu/users/jchiang/lc.fits.gz) files.\n",
    "\n",
    "* **flux** - Mean flux during the active state in units of m-2 s-1.\n",
    "* **tstart** - Start time of the active state in MET seconds.\n",
    "* **tstop** - Stop time of the active state in MET seconds.\n",
    "* **template** file - Filename of the light curve template. May be ascii or FITS.\n",
    "* **Emin (default: 20)** - Minimum photon energy in MeV.\n",
    "* **Emax (default: 2e5)** - Maximum photon energy in MeV.\n",
    "* **lc (default: 0)** - light curve number, if FITS file.\n",
    "* **z (default: 0)** - Redshift used for EBL attenuation calculation.\n",
    "* **useLogParabola (default = 0)**"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "```xml\n",
    "<source name=\"spectral_transient\">\n",
    "   <spectrum escale=\"MeV\">\n",
    "      <SpectrumClass name=\"SpectralTransient\" params=\"flux=1e-1, tstart=0.,tstop=1e4,templateFile=$(FERMI_DIR)/refdata/fermi/genericSources/testTemplate.dat,emin=20, emax=2e5, lc=0, z=0, useLogParabola=0\"/>\n",
    "      <celestial_dir ra=\"193.4\" dec=\"-5.82\"/>\n",
    "   </spectrum>\n",
    "</source>\n",
    "```\n",
    "You may download the xml file from [here](https://fermi.gsfc.nasa.gov/ssc/data/analysis/scitools/data/OtherSrsObssim/SpectralTransient.xml). "
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# TransientTemplate:\n",
    "\n",
    "A point source transient whose active state light curve shape is given by an ascii template file.\n",
    "\n",
    "* **flux** - Mean flux during the active state in units of m-2 s-1.\n",
    "* **gamma** - Photon spectral index such that dN/dE ∝ E-Γ.\n",
    "* **tstart** - Start time of the active state in MET seconds.\n",
    "* **tstop** - Stop time of the active state in MET seconds.\n",
    "* **template file** - Filename of the ascii light curve template. The file should consist of two columns, time and intensity. The time intervals must be uniformly spaced. The time scale and absolute intensities are arbitrary and rescaled using the flux, tstop, and tstep parameter values.\n",
    "* **Emin (default: 30)** - Minimum photon energy in MeV.\n",
    "* **Emax (default: 1e5)** - Maximum photon energy in MeV."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "```xml\n",
    "<source name=\"transient_template\">\n",
    "   <spectrum escale=\"MeV\">\n",
    "      <SpectrumClass name=\"TransientTemplate\" params=\"100.,2,1e3,1.1e3,$(FERMI_DIR)/refdata/fermi/observationSim/CrabTemplate.dat\"/>\n",
    "      <celestial_dir ra=\"80\" dec=\"20\"/>\n",
    "   </spectrum>\n",
    "</source>\n",
    "```\n",
    "You may download the xml file from [here](https://fermi.gsfc.nasa.gov/ssc/data/analysis/scitools/data/OtherSrsObssim/TransientTemplate.xml). "
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Related FTOOLS\n",
    "\n",
    "* [gtobssim](https://fermi.gsfc.nasa.gov/ssc/data/analysis/scitools/help/gtobssim.txt)\n",
    "* [gtorbsim](https://fermi.gsfc.nasa.gov/ssc/data/analysis/scitools/help/gtorbsim.txt)"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 2",
   "language": "python",
   "name": "python2"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 2
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython2",
   "version": "2.7.14"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
